#include "client.h"
#include "log.h"
#include "business/video.h"
#include "clientmanger.h"

Client::Client(int sid):Session(sid)
{
}

void Client::doWork(const Protocal& in)
{
	//处理
	Session::doWork(in);

	char type = in.head.id;
	uint32_t bounds = in.head.counter;
	const std::vector<char> data = in.body;
	std::vector<char> ret;
	int textbounds = 0;
	switch ((Catag)type) {
		case Catag::VIDEO:
		case Catag::PLAIN:
		{
			Video v(data, bounds);
			ret = v.GetHandleResult();
			textbounds = v.GetResponseBounds();
			break;
		}
	}

	// 发送
	Session::doSend(type, textbounds, ret);
}

